package timu3;

public class ConnectionFactory {
    public static Connection createConnection(String type){
        switch (type.toLowerCase()){
            case "mysql":
                return new MySQLConnection();
            case "postgresql":
                return new PostgreSQLConnection();
            default:
                throw  new IllegalArgumentException("错误的数据库"+type);
        }
    }
}
